import request from '@/utils/request.js'
export function articles (id) {
  return request({ url: '/v1_0/articles/' + id })
}
export function userFollowings (target, bol) {
  if (bol) {
    return request({
      url: '/v1_0/user/followings',
      method: 'post',
      data: { target }
    })
  } else {
    return request({ url: '/v1_0/user/followings/' + target, method: 'delete' })
  }
}
export function comments (params) {
  console.log(params)
  return request({ url: '/v1_0/comments', params })
}
export function articleLikings (target, bol = true) {
  if (bol) {
    return request({
      url: '/v1_0/article/likings',
      method: 'post',
      data: { target }
    })
  } else {
    return request({ url: '/v1_0/article/likings/' + target, method: 'delete' })
  }
}
export function commentsPost (data) {
  return request({
    url: '/v1_0/comments',
    method: 'post',
    data
  })
}
